import request from '@/utils/request'


// 获取党务试题类型下拉树列表
export function treeSelect() {
  return request({
    url: '/web/dj/questionKind/treeSelect',
    method: 'get',
    jy: true
  })
}

// 新增党务试题分类
export function addClassify(data) {
  return request({
    url: `/web/dj/questionKind/add`,
    method: 'post',
    data,
    jy: true
  })
}

// 修改党务试题分类
export function editClassify(data) {
  return request({
    url: `/web/dj/questionKind/edit`,
    method: 'PUT',
    data,
    jy: true
  })
}

// 删除党务试题分类
export function deleteClassify(id) {
  return request({
    url: `/web/dj/questionKind/${id}`,
    method: 'delete',
    jy: true
  })
}

// 试题分页列表
export function getQuestionPage(params) {
  return request({
    url: `/web/dj/question/page`,
    method: 'get',
    params,
    jy: true
  })
}

// 删除试题
export function deleteQuestion(ids) {
  return request({
    url: `/web/dj/question/${ids}`,
    method: 'delete',
    jy: true
  })
}

// 废弃试题
export function abandonQuestion(data) {
  return request({
    url: `/web/dj/question/abandon`,
    method: 'post',
    data,
    jy: true
  })
}

// 恢复试题
export function restorePublishQuestion(data) {
  return request({
    url: `/web/dj/question/restorePublish`,
    method: 'post',
    data,
    jy: true
  })
}

// 查看单条试题具体信息
export function getQuestionInfo(params) {
  return request({
    url: `/web/dj/question/getInfo`,
    method: 'get',
    params,
    jy: true
  })
}

// 编辑试题包括新增与修改
export function addOrEditQuestion(data) {
  return request({
    url: `/web/dj/question/edit`,
    method: 'post',
    data,
    jy: true
  })
}

// 试题发布
export function publishQuestion(data) {
  return request({
    url: `/web/dj/question/publish`,
    method: 'post',
    data,
    jy: true
  })
}
